package com.gzhu.knowledgeAdmin.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gzhu.knowledgeAdmin.entity.TRwT;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
@Mapper
public interface TRwTMapper extends BaseMapper<TRwT> {


    List<TRwT> selectBySearch(@Param("tRwT") TRwT tRwT);

    Long selectMaxNum();

    Integer updateTask(@Param("tRwT") TRwT tRwT);

    List<String> findOwners();

    Integer startTasks(List<Long> rwids);

    Integer stopTasks(List<Long> rwids);

    Integer recallTasks(List<Long> rwids);

    @Select("SELECT t_rw_t.*, t_gsxx_t.f_gsmc AS companyName FROM t_rw_t " +
            " LEFT JOIN t_gsxx_t ON t_rw_t.f_gsid = t_gsxx_t.f_gsid")
    List<Map<String, Object>> selectAllTasksWithCompanyName();
}
